import dva from 'dva';
import './index.less';
import 'antd-mobile/dist/antd-mobile.css';






(function (doc, win) {
        var docEl = doc.documentElement,
            resizeEvt = 'onorientationchange' in window ? 'onorientationchange' : 'resize',
            recalc = function () {
                var clientWidth = docEl.clientWidth;
                if (!clientWidth) return;
                if(clientWidth>=750){
                    docEl.style.fontSize = '100px';
                }else{
                    docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
                }
            };

        if (!doc.addEventListener) return;
        win.addEventListener(resizeEvt, recalc, false);
        doc.addEventListener('DOMContentLoaded', recalc, false);
    })(document, window);


// 1. Initialize
const app = dva();

// 2. Plugins
// app.use({});

// 3. Model
app.model(require('./models/global').default);
app.model(require('./models/homeGoods').default);
app.model(require('./models/tableGoods').default);
app.model(require('./models/banner').default);
app.model(require('./models/bulletin').default);
app.model(require('./models/shoppingCart').default);
app.model(require('./models/timeMag').default)
app.model(require('./models/order').default)




// 4. Router
app.router(require('./router').default);

// 5. Start
app.start('#root');



